package com.vne.skyemart.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.vne.skyemart.dao.ShippingTypeDao;
import com.vne.skyemart.model.ShippingType;
import com.vne.skyemart.service.ShippingTypeService;

@Service("shippingTypeService")
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true)
public class ShippingTypeServiceImpl implements ShippingTypeService{
	@Autowired
	private ShippingTypeDao shippingTypeDao;

	public ShippingTypeDao getShippingTypeDao() {
		return shippingTypeDao;
	}

	public void setShippingTypeDao(ShippingTypeDao shippingTypeDao) {
		this.shippingTypeDao = shippingTypeDao;
	}
	public ShippingTypeServiceImpl() {}
	@Transactional(propagation = Propagation.SUPPORTS,readOnly = false)
	@Override
	public void addShippingType(ShippingType shippingtype) {
		shippingTypeDao.save(shippingtype);
	}

	@Override
	public List<ShippingType> listShippingType() {
		return shippingTypeDao.findAll();
	}
	
}
